import React, { useState, useEffect } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { Banner, VotingMain } from './components';
import { callGetNewsApi } from 'utils/networking';
import { useDispatch } from 'react-redux';
import { setSteamVideo } from 'redux/actions/CoverActions';
const useStyles = makeStyles(theme => ({
  content: {
    backgroundColor: "#000",
  },
}));

const Voting = () => {
  const classes = useStyles();
  const dispatch = useDispatch();

  useEffect(() => {
    getServerVideoProps()
  }, [])
  const getServerVideoProps = async () => {
    callGetNewsApi('cover/steam_video', dispatch, (data) => {
      dispatch(setSteamVideo(data));
    });
  }
  return (
    <div className={classes.content}>
      <Banner />
      <VotingMain />
    </div>
  );
};

export default Voting;
